/*
 JIFFilmNouveau

 Encore un paquet de PS a faire
 */
package cinescope2014.boundaries;

import cinescope2014.utilities.Globale;
import cinescope2014.utilities.UtilitairesBD2IHM;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultCellEditor;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;

/**
 *
 * @author pascal
 */
public class JIFFilmNouveau extends javax.swing.JInternalFrame {

    private Connection icn;

    private Map<String, String> imapGenres;
    private Map<String, String> imapRubriques;
    private Map<String, String> imapInterdictions;
    private Map<String, String> imapPublics;
    private Map<String, String> imapPays;
    private Map<String, String> imapArtistes;
    private Map<String, String> imapActeurs;
    private Map<String, String> imapRealisateurs;
    private Map<String, String> imapSalles;

    private DefaultTableModel idtmJouer;
    private DefaultTableModel idtmRealiser;
    private DefaultTableModel idtmProduire;
    private DefaultTableModel idtmProjeter;

    private GregorianCalendar igcAujourdhui;
    private String isAujourdhui;

    private JComboBox jcbxActeurs = new JComboBox();
    private JComboBox jcbxRealisateurs = new JComboBox();
    private JComboBox jcbxPays = new JComboBox();
    private JComboBox jcbxSalles = new JComboBox();

    /**
     * Creates new form JIFFilmNouveau
     */
    public JIFFilmNouveau() {
        initComponents();

        igcAujourdhui = new GregorianCalendar();
        int liAnnee = igcAujourdhui.get(Calendar.YEAR);
        int liMois = igcAujourdhui.get(Calendar.MONTH) + 1;
        int liJour = igcAujourdhui.get(Calendar.DAY_OF_MONTH);

        // Le mercredi (4ème jour)
        int liJourSemaine = igcAujourdhui.get(Calendar.DAY_OF_WEEK);
        System.out.println(liJourSemaine);
        // Non il faut creer une Nouvelle date et lui ajouter n jours
//        GregorianCalendar mercredi = new GregorianCalendar();
        if (liJourSemaine < 4) { /// Dimanche, lundi ou mardi
            //liJour += (4 - liJourSemaine);
            igcAujourdhui.add(Calendar.DAY_OF_MONTH, 4 - liJourSemaine);
            liJour = igcAujourdhui.get(Calendar.DAY_OF_MONTH);
        } else {
            if (liJourSemaine > 4) { // Jeudi:5 donc+6, vendredi:6 donc+5, samedi:7 donc+4
                if (liJourSemaine == 5) {
                    igcAujourdhui.add(Calendar.DAY_OF_MONTH, 6);
                }
                if (liJourSemaine == 6) {
                    igcAujourdhui.add(Calendar.DAY_OF_MONTH, 5);
                }
                if (liJourSemaine == 7) {
                    igcAujourdhui.add(Calendar.DAY_OF_MONTH, 4);
                }
                liJour = igcAujourdhui.get(Calendar.DAY_OF_MONTH);
            }
        }

        isAujourdhui = liAnnee + "-" + liMois + "-" + liJour;

        jTextFieldDateDeSortie.setText(isAujourdhui);

        icn = Globale.getConnexion();

//        try {
//            Statement lst = icn.createStatement();
//            lst.execute("START TRANSACTION");
//        } catch (SQLException ex) {
//            Logger.getLogger(JIFFilmNouveau.class.getName()).log(Level.SEVERE, null, ex);
//        }
        jSpinnerSemaines.setValue(0);
        jTextFieldEntreesSemaines.setText("0");
        jTextFieldTotalEntrees.setText("0");

        jSpinnerSemaines.setEnabled(false);
        jTextFieldEntreesSemaines.setEnabled(false);
        jTextFieldTotalEntrees.setEnabled(false);

        setTitle("Nouveau film");

        // Semaines
        SpinnerModel modeleSpinnerSemaines
                = new SpinnerNumberModel(0, //initial value
                        0, //min
                        104, //max : 2 ans
                        1); // step
        this.jSpinnerSemaines.setModel(modeleSpinnerSemaines);

        // Heures
        SpinnerModel modeleSpinnerHeures
                = new SpinnerNumberModel(1, //initial value
                        0, //min
                        24, //max
                        1); // step
        this.jSpinnerDureeHeures.setModel(modeleSpinnerHeures);

        // Minutes
        SpinnerModel modeleSpinnerMinutes
                = new SpinnerNumberModel(0, //initial value
                        0, //min
                        59, //max
                        1); // step
        this.jSpinnerDureeMinutes.setModel(modeleSpinnerMinutes);

        // Annees
//        liAnnee = igcAujourdhui.get(Calendar.YEAR);
        SpinnerModel modeleSpinnerAnnees
                = new SpinnerNumberModel(liAnnee, //initial value
                        1900, //min
                        liAnnee, //max
                        1); // step

        this.jSpinnerAnneeProduction.setModel(modeleSpinnerAnnees);

        // Couleurs
        String[] tPays = {"Couleurs", "Noir et blanc", "Mixte"};
        jListCouleurs.setListData(tPays);
        jListCouleurs.setSelectedIndex(0);

        // Interdictions
        String[] tInterdictions = {"18", "16", "13", "Aucune"};
        jListInterdictions.setListData(tInterdictions);
        jListInterdictions.setSelectedValue("Aucune", true);

        // Public
        String[] tPublics = {"Enfants", "Adolescents", "Tous publics", "Restreint"};
        jListPublics.setListData(tPublics);
        jListPublics.setSelectedValue("Tous publics", true);

        // Genres
        String[] tGenres = UtilitairesBD2IHM.sql2Array(icn, "SELECT libelle_genre FROM genre");
        DefaultComboBoxModel cmbModeleGenres = new DefaultComboBoxModel(tGenres);

        jComboBoxGenres.setModel(cmbModeleGenres);

        imapGenres = UtilitairesBD2IHM.sql2Map(icn, "SELECT * FROM genre", "libelle_genre", "id_genre");

        // Rubriques
        String[] tRubriques = UtilitairesBD2IHM.sql2Array(icn, "SELECT intitule_rubrique FROM rubrique");
        DefaultComboBoxModel cmbModeleRubriques = new DefaultComboBoxModel(tRubriques);

        jComboBoxRubriques.setModel(cmbModeleRubriques);
        jComboBoxRubriques.setSelectedItem("Films nouveaux");
        jComboBoxRubriques.setEnabled(false);

        imapRubriques = UtilitairesBD2IHM.sql2Map(icn, "SELECT * FROM rubrique", "intitule_rubrique", "id_rubrique");

        // INTERDICTIONS
        imapInterdictions = new HashMap();

        imapInterdictions.put("Aucune", "1");
        imapInterdictions.put("13", "2");
        imapInterdictions.put("16", "3");
        imapInterdictions.put("18", "4");

        // PUBLICS
        imapPublics = new HashMap();

        imapPublics.put("Tous publics", "1");
        imapPublics.put("Enfants", "2");
        imapPublics.put("Adolescents", "3");
        imapPublics.put("Restreint", "4");

        // Onglets pour Acteurs, Realisateurs, Pays de production, Projections, (Festivals)
//        jTabbedPane1.addTab("Acteurs", null, null,
//                "Does nothing");
//        jTabbedPane1.addTab("Réalisateurs", null, null,
//                "Does nothing");
//        jTabbedPane1.addTab("Pays", null, null,
//                "Does nothing");
//        jTabbedPane1.addTab("Projections", null, null,
//                "Does nothing");
        idtmJouer = (DefaultTableModel) jTableJouer.getModel();
        idtmRealiser = (DefaultTableModel) jTableRealiser.getModel();
        idtmProduire = (DefaultTableModel) jTableProduire.getModel();
        idtmProjeter = (DefaultTableModel) jTableProjeter.getModel();

        ajoutJComboPays();
        ajoutJComboActeurs();
        ajoutJComboRealisateurs();
        ajoutJComboSalles();

        // VISIBLE
        setVisible(true);
    } /// Constructeur

    /**
     *
     */
    private void ajoutJComboPays() {
        imapPays = new HashMap<>();

        /*
         * LA COLONNE SPECIALE (APRES LE REMPLISSAGE DE LA JTABLE)
         */
        jcbxPays = new JComboBox();
//        jcbxPays.addItem("France");
//        jcbxPays.addItem("Italie");
//        jcbxPays.addItem("Espagne");
        String lsSQL = "{CALL paysSelectAll()}";
        try {
            PreparedStatement lpst = icn.prepareStatement(lsSQL);
            ResultSet lrs = lpst.executeQuery();
            while (lrs.next()) {
                imapPays.put(lrs.getString("nom_pays"), lrs.getString("id_pays"));
                jcbxPays.addItem(lrs.getString("nom_pays"));
            }
        } catch (SQLException ex) {
            System.out.println(ex);
        }

        TableColumn tableColonnePays = jTableProduire.getColumnModel().getColumn(1);

        TableCellEditor tableCelluleEditeur = new DefaultCellEditor(jcbxPays);
        tableColonnePays.setCellEditor(tableCelluleEditeur);

//        jcbxPays.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent ae) {
//                //jTablePays.setValueAt(imapPays.get(jcbxPays.getSelectedItem().toString()), jTablePays.getSelectedRow(), 3);
//                //System.out.println("pays selectionne : " + jcbxPays.getSelectedItem().toString());
//                System.out.println(jTablePays.getValueAt(jTablePays.getSelectedRow(), 1));
//            }
//        });
        // Largeur de la colonne de la JTable
        tableColonnePays.setPreferredWidth(300);

    } /// ajoutJComboPays

    /**
     *
     */
    private void ajoutJComboActeurs() {
        imapActeurs = new HashMap<>();
        jcbxActeurs = new JComboBox();
        String lsSQL = "SELECT id_artiste, nom_artiste FROM artiste ORDER BY 2";
        try {
            PreparedStatement lpst = icn.prepareStatement(lsSQL);
            ResultSet lrs = lpst.executeQuery();
            while (lrs.next()) {
                imapActeurs.put(lrs.getString("nom_artiste"), lrs.getString("id_artiste"));
                jcbxActeurs.addItem(lrs.getString("nom_artiste"));
            }
        } catch (SQLException ex) {
            System.out.println(ex);
        }

        TableColumn tableColonnePays = jTableJouer.getColumnModel().getColumn(1);

        TableCellEditor tableCelluleEditeur = new DefaultCellEditor(jcbxActeurs);
        tableColonnePays.setCellEditor(tableCelluleEditeur);

        tableColonnePays.setPreferredWidth(300);

    } /// ajoutJComboActeurs

    /**
     *
     */
    private void ajoutJComboRealisateurs() {
        imapRealisateurs = new HashMap<>();
        jcbxRealisateurs = new JComboBox();
        String lsSQL = "SELECT id_artiste, nom_artiste FROM artiste ORDER BY 2";
        try {
            PreparedStatement lpst = icn.prepareStatement(lsSQL);
            ResultSet lrs = lpst.executeQuery();
            while (lrs.next()) {
                imapRealisateurs.put(lrs.getString("nom_artiste"), lrs.getString("id_artiste"));
                jcbxRealisateurs.addItem(lrs.getString("nom_artiste"));
            }
        } catch (SQLException ex) {
            System.out.println(ex);
        }

        TableColumn tableColonnePays = jTableRealiser.getColumnModel().getColumn(1);

        TableCellEditor tableCelluleEditeur = new DefaultCellEditor(jcbxRealisateurs);
        tableColonnePays.setCellEditor(tableCelluleEditeur);

        tableColonnePays.setPreferredWidth(300);

    } /// ajoutJComboRealisateurs

    /**
     *
     */
    private void ajoutJComboSalles() {
        imapSalles = new HashMap<>();

        /*
         * LA COLONNE SPECIALE (APRES LE REMPLISSAGE DE LA JTABLE)
         */
        jcbxSalles = new JComboBox();
        String lsSQL = "SELECT id_salle FROM salle";
        try {
            PreparedStatement lpst = icn.prepareStatement(lsSQL);
            ResultSet lrs = lpst.executeQuery();
            while (lrs.next()) {
                imapSalles.put(lrs.getString("id_salle"), lrs.getString("id_salle"));
                jcbxSalles.addItem(lrs.getString("id_salle"));
            }
        } catch (SQLException ex) {
            System.out.println(ex);
        }

        TableColumn tableColonnePays = jTableProjeter.getColumnModel().getColumn(1);

        TableCellEditor tableCelluleEditeur = new DefaultCellEditor(jcbxSalles);
        tableColonnePays.setCellEditor(tableCelluleEditeur);

        tableColonnePays.setPreferredWidth(300);

    } /// ajoutJComboPays    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextFieldTitre = new javax.swing.JTextField();
        jTextFieldTitreOriginal = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldTotalEntrees = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jTextFieldEntreesSemaines = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextAreaSynopsis = new javax.swing.JTextArea();
        jSpinnerSemaines = new javax.swing.JSpinner();
        jSpinnerDureeHeures = new javax.swing.JSpinner();
        jSpinnerDureeMinutes = new javax.swing.JSpinner();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jSpinnerAnneeProduction = new javax.swing.JSpinner();
        jScrollPane2 = new javax.swing.JScrollPane();
        jListCouleurs = new javax.swing.JList();
        jScrollPane3 = new javax.swing.JScrollPane();
        jListInterdictions = new javax.swing.JList();
        jScrollPane4 = new javax.swing.JScrollPane();
        jListPublics = new javax.swing.JList();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jComboBoxRubriques = new javax.swing.JComboBox();
        jComboBoxGenres = new javax.swing.JComboBox();
        jLabelMessage = new javax.swing.JLabel();
        jTabbel1 = new javax.swing.JTabbedPane();
        jScrollPaneActeurs = new javax.swing.JScrollPane();
        jTableJouer = new javax.swing.JTable();
        jScrollPaneRealisateurs = new javax.swing.JScrollPane();
        jTableRealiser = new javax.swing.JTable();
        jScrollPanePays = new javax.swing.JScrollPane();
        jTableProduire = new javax.swing.JTable();
        jScrollPaneProjections = new javax.swing.JScrollPane();
        jTableProjeter = new javax.swing.JTable();
        jButtonValiderAjout = new javax.swing.JButton();
        jButtonPlus = new javax.swing.JButton();
        jButtonNouveau = new javax.swing.JButton();
        jButtonMoins = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jTextFieldDateDeSortie = new javax.swing.JTextField();
        jButtonCLS = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);

        jLabel1.setText("Titre");

        jLabel2.setText("Titre original");

        jTextFieldTitre.setText("Miss Harriet");

        jTextFieldTitreOriginal.setText("Miss Harriet");

        jLabel3.setText("Total des entrées");

        jTextFieldTotalEntrees.setText("1000000");

        jLabel4.setText("Entrées de la semaine");

        jLabel5.setText("Nombre de semaines");

        jTextFieldEntreesSemaines.setText("100000");

        jLabel6.setText("Année de production");

        jLabel7.setText("Durée");

        jLabel8.setText("Synopsis");

        jLabel9.setText("Couleurs");

        jLabel10.setText("Interdiction");

        jLabel11.setText("Public");

        jTextAreaSynopsis.setColumns(20);
        jTextAreaSynopsis.setRows(5);
        jTextAreaSynopsis.setText("Horrible !!!");
        jScrollPane1.setViewportView(jTextAreaSynopsis);

        jLabel12.setText("heure(s)");

        jLabel13.setText("minute(s)");

        jListCouleurs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(jListCouleurs);

        jListInterdictions.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane3.setViewportView(jListInterdictions);

        jListPublics.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane4.setViewportView(jListPublics);

        jLabel14.setText("Genre");

        jLabel15.setText("Rubrique");

        jLabelMessage.setText("message :");

        jTableJouer.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID film", "Acteur", "Rang", "Voix"
            }
        ));
        jScrollPaneActeurs.setViewportView(jTableJouer);

        jTabbel1.addTab("Acteurs", jScrollPaneActeurs);

        jTableRealiser.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID film", "Réalisateur"
            }
        ));
        jScrollPaneRealisateurs.setViewportView(jTableRealiser);

        jTabbel1.addTab("Réalisateurs", jScrollPaneRealisateurs);

        jTableProduire.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null}
            },
            new String [] {
                "ID film", "Pays", "Rang", "ID Pays"
            }
        ));
        jScrollPanePays.setViewportView(jTableProduire);

        jTabbel1.addTab("Pays", jScrollPanePays);

        jTableProjeter.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID film", "Salle", "Version", "Horaires"
            }
        ));
        jScrollPaneProjections.setViewportView(jTableProjeter);

        jTabbel1.addTab("Projections", jScrollPaneProjections);

        jButtonValiderAjout.setText("Valider ajout");
        jButtonValiderAjout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonValiderAjoutActionPerformed(evt);
            }
        });

        jButtonPlus.setText("+");
        jButtonPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPlusActionPerformed(evt);
            }
        });

        jButtonNouveau.setText("Nouveau");
        jButtonNouveau.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNouveauActionPerformed(evt);
            }
        });

        jButtonMoins.setText("-");
        jButtonMoins.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonMoinsActionPerformed(evt);
            }
        });

        jLabel16.setText("Date de sortie");

        jTextFieldDateDeSortie.setText("2014-07-30");

        jButtonCLS.setText("CLS");
        jButtonCLS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCLSActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15)
                            .addComponent(jLabel11))
                        .addGap(78, 78, 78)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jComboBoxRubriques, javax.swing.GroupLayout.Alignment.LEADING, 0, 153, Short.MAX_VALUE)
                                .addComponent(jComboBoxGenres, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabelMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 609, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel7))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jSpinnerDureeHeures, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel12))
                                            .addComponent(jSpinnerAnneeProduction, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(59, 59, 59)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jSpinnerDureeMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel13))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel16)
                                                .addGap(18, 18, 18)
                                                .addComponent(jTextFieldDateDeSortie, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTextFieldEntreesSemaines, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel3)
                                        .addGap(28, 28, 28)
                                        .addComponent(jTextFieldTotalEntrees, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabel5))))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2))
                                .addGap(64, 64, 64)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jTextFieldTitreOriginal, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTextFieldTitre, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(18, 18, 18)
                        .addComponent(jSpinnerSemaines, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jButtonValiderAjout, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(111, 111, 111)
                                .addComponent(jButtonCLS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(jTabbel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 623, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonPlus, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButtonMoins, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButtonNouveau))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFieldTitre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldTitreOriginal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextFieldEntreesSemaines, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jTextFieldTotalEntrees, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jSpinnerSemaines, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(jSpinnerAnneeProduction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldDateDeSortie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jSpinnerDureeHeures, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel12)
                        .addComponent(jSpinnerDureeMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13))
                    .addComponent(jLabel7))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel8))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel14))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jComboBoxGenres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15)
                    .addComponent(jComboBoxRubriques, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jTabbel1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonValiderAjout)
                            .addComponent(jButtonCLS))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButtonPlus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonMoins)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonNouveau)
                        .addGap(66, 66, 66)))
                .addComponent(jLabelMessage)
                .addContainerGap(67, Short.MAX_VALUE))
        );

        jTabbel1.getAccessibleContext().setAccessibleName("Acteurs");
        jTabbel1.getAccessibleContext().setAccessibleDescription("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonValiderAjoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonValiderAjoutActionPerformed
        //

        try {
            String lsSQL;
            /*
             filmInsert`(paramID_FILM INT(10),paramID_GENRE INT(10),paramID_RUBRIQUE INT(10),paramTITRE_FILM VARCHAR(50),
             paramTITRE_ORIGINAL VARCHAR(50),paramTOTAL_ENTREES DECIMAL(10),paramDATE_SORTIE DATE,
             paramENTREES_SEMAINE DECIMAL(10),paramNOMBRE_SEMAINES DECIMAL(5),paramANNEE DECIMAL(4),paramDUREE VARCHAR(10),
             paramCONDENSE VARCHAR(1000),paramCOULEURS VARCHAR(20),paramINTERDICTION_FILM INT(10),paramPUBLIC_FILM INT(10))
             */
            lsSQL = "{CALL filmInsert(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
            PreparedStatement lpstFilm = icn.prepareStatement(lsSQL, PreparedStatement.RETURN_GENERATED_KEYS);
            lpstFilm.setString(1, null);
            lpstFilm.setString(2, imapGenres.get(jComboBoxGenres.getSelectedItem().toString()));
            lpstFilm.setString(3, imapRubriques.get(jComboBoxRubriques.getSelectedItem().toString()));
            lpstFilm.setString(4, jTextFieldTitre.getText());
            lpstFilm.setString(5, jTextFieldTitreOriginal.getText());
            lpstFilm.setString(6, jTextFieldTotalEntrees.getText());
            lpstFilm.setString(7, isAujourdhui);
            lpstFilm.setString(8, jTextFieldEntreesSemaines.getText());
            lpstFilm.setString(9, jSpinnerSemaines.getValue().toString());
            lpstFilm.setString(10, jSpinnerAnneeProduction.getValue().toString());
            lpstFilm.setString(11, jSpinnerDureeHeures.getValue().toString() + ":" + jSpinnerDureeMinutes.getValue().toString());
            lpstFilm.setString(12, jTextAreaSynopsis.getText());
            lpstFilm.setString(13, jListCouleurs.getSelectedValue().toString());
            lpstFilm.setString(14, imapInterdictions.get(jListInterdictions.getSelectedValue().toString())); // Interdiction
            lpstFilm.setString(15, imapPublics.get(jListPublics.getSelectedValue().toString())); // Public

            lpstFilm.executeUpdate();

            lsSQL = "{? = CALL get_new_ID()}";
            CallableStatement lcst = icn.prepareCall(lsSQL);
            lcst.registerOutParameter(1, Types.INTEGER);
            lcst.execute();
            int liIdFilm = lcst.getInt(1);
            lcst.close();

//            int liRang = 1;
            // JOUER
            // jouerInsert(paramID_ARTISTE INT(10),paramID_FILM INT(10),paramRANG_ACTEUR DECIMAL(2),paramVOIX CHAR(1))
            if (jTableJouer.getRowCount() > 0) {
                lsSQL = "{CALL jouerInsert(?,?,?,?)}";

                PreparedStatement lpstJouer = icn.prepareStatement(lsSQL);
                int liRang = 1;
                for (int i = 0; i < jTableJouer.getRowCount(); i++) {
                    jTableJouer.setValueAt(liIdFilm, i, 0);
                    jTableJouer.setValueAt(liRang, i, 2);
                    // id acteur
                    String lsNomArtiste = jTableJouer.getValueAt(i, 1).toString();
                    String lsIdArtiste = imapActeurs.get(lsNomArtiste);

                    // id film
                    lpstJouer.setInt(2, liIdFilm);
                    // id acteur
                    lpstJouer.setString(1, lsIdArtiste);
                    // rang
                    lpstJouer.setInt(3, liRang);
                    // voix
                    lpstJouer.setString(4, "N");
                    
                    System.out.println("Acteur : " + lsIdArtiste);
                    
                    // INSERT
                    lpstJouer.executeUpdate();

                    liRang++;
                    
                }
                lpstJouer.close();
            } /// if jouer

            // REALISER
            if (jTableRealiser.getRowCount() > 0) {
                // realiserInsert(paramID_ARTISTE INT(10),paramID_FILM INT(10))
                lsSQL = "{CALL realiserInsert(?,?)}";
                PreparedStatement lpstRealiser = icn.prepareStatement(lsSQL);

                for (int i = 0; i < jTableRealiser.getRowCount(); i++) {
                    jTableRealiser.setValueAt(liIdFilm, i, 0);
                    // artiste
                    String lsNomArtiste = jTableRealiser.getValueAt(i, 1).toString();
                    String lsIdArtiste = imapRealisateurs.get(lsNomArtiste);
                    // id artiste
                    lpstRealiser.setString(1, lsIdArtiste);
                    // id film
                    lpstRealiser.setInt(2,liIdFilm);
                    
                    System.out.println("Réalisateur : " + lsIdArtiste);
                    // INSERT
                    lpstRealiser.executeUpdate();
                }
                lpstRealiser.close();
            } /// if realiser

            // PRODUIRE
            if (jTableProduire.getRowCount() > 0) {
                // produireInsert(paramID_PAYS INT(10),paramID_FILM INT(10),paramRANG_PRODUCTION DECIMAL(2))
                lsSQL = "{CALL produireInsert(?,?,?)}";
                PreparedStatement lpstProduire = icn.prepareStatement(lsSQL);
                int liRang = 1;
                for (int i = 0; i < jTableProduire.getRowCount(); i++) {
                    jTableProduire.setValueAt(liIdFilm, i, 0);
                    jTableProduire.setValueAt(liRang, i, 2);

                    // recup nom pays
                    //String lsNomPays = jcbxPays.getSelectedItem().toString();
                    String lsNomPays = jTableProduire.getValueAt(i, 1).toString();
                    // recup idpays
                    String lsIdPays = imapPays.get(lsNomPays);

                    // idpays
                    lpstProduire.setString(1, lsIdPays);
                    // idFilm
                    lpstProduire.setInt(2, liIdFilm);
                    // rang
                    lpstProduire.setInt(3, liRang);
                    
                    System.out.println("Pays : " + lsIdPays);
                    
                    // INSERT
                    lpstProduire.executeUpdate();

                    liRang++;

                    System.out.println("Nom pays : " + lsNomPays);
                    System.out.println("ID pays : " + lsIdPays);
                }
                lpstProduire.close();
            } /// if produire

            // PROJETER
            if (jTableProjeter.getRowCount() > 0) {
                // projeterInsert(paramID_FILM, paramID_SALLE , paramVERSION_PROJECTION, paramHORAIRES_PROJECTION)
                lsSQL = "{CALL projeterInsert(?,?,?,?)}";
                PreparedStatement lpstProjeter = icn.prepareStatement(lsSQL);
                for (int i = 0; i < jTableProjeter.getRowCount(); i++) {
                    jTableProjeter.setValueAt(liIdFilm, i, 0);
                    // idFilm
                    lpstProjeter.setInt(1, liIdFilm);
                    // id_salle
                    lpstProjeter.setString(2, jTableProjeter.getValueAt(i, 1).toString());
                    // version
                    lpstProjeter.setString(3, "VO");
                    // horaires
                    lpstProjeter.setString(4, "14:00-16:00");

                    lpstProjeter.executeUpdate();

//                    System.out.println("Nom pays : " + lsNomPays);
//                    System.out.println("ID pays : " + lsIdPays);
                }
                lpstProjeter.close();
            } /// if projeter            

            /*
             VALIDATION DEFINITIVE
             */
            icn.commit();

            lpstFilm.close();

            jLabelMessage.setText("OK !!!");
        } catch (SQLException e) {
            System.err.println(e);
            try {
                icn.rollback();
            } catch (SQLException ex) {
                Logger.getLogger(JIFFilmNouveau.class.getName()).log(Level.SEVERE, null, ex);
            }
            jLabelMessage.setText(e.getMessage());
        }
    }//GEN-LAST:event_jButtonValiderAjoutActionPerformed

    private void jButtonPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPlusActionPerformed
        //

        String[] tLigne;

        if (jTabbel1.getSelectedIndex() == 0) {
            jLabelMessage.setText("Acteur");
            tLigne = new String[4];
            idtmJouer.addRow(tLigne);
        }
        if (jTabbel1.getSelectedIndex() == 1) {
            tLigne = new String[2];
            idtmRealiser.addRow(tLigne);
            jLabelMessage.setText("Réalisateur");
        }
        if (jTabbel1.getSelectedIndex() == 2) {
            tLigne = new String[4];
            idtmProduire.addRow(tLigne);
            jLabelMessage.setText("Pays");
        }
        if (jTabbel1.getSelectedIndex() == 3) {
            tLigne = new String[4];
            idtmProjeter.addRow(tLigne);
            jLabelMessage.setText("Projection");
        }
    }//GEN-LAST:event_jButtonPlusActionPerformed

    private void jButtonMoinsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoinsActionPerformed
        //
        if (jTabbel1.getSelectedIndex() == 0) {
            if (jTableJouer.getSelectedRow() != -1) {
                idtmJouer.removeRow(jTableJouer.getSelectedRow());
            } else {
                jLabelMessage.setText("Sélectionnez une ligne !!!");
            }
        }
        if (jTabbel1.getSelectedIndex() == 1) {
            if (jTableRealiser.getSelectedRow() != -1) {
                idtmRealiser.removeRow(jTableRealiser.getSelectedRow());
            } else {
                jLabelMessage.setText("Sélectionnez une ligne !!!");
            }
        }
        if (jTabbel1.getSelectedIndex() == 2) {
            if (jTableProduire.getSelectedRow() != -1) {
                idtmProduire.removeRow(jTableProduire.getSelectedRow());
            } else {
                jLabelMessage.setText("Sélectionnez une ligne !!!");
            }
        }
        if (jTabbel1.getSelectedIndex() == 3) {
            if (jTableProjeter.getSelectedRow() != -1) {
                idtmProjeter.removeRow(jTableProjeter.getSelectedRow());
            } else {
                jLabelMessage.setText("Sélectionnez une ligne !!!");
            }
        }
    }//GEN-LAST:event_jButtonMoinsActionPerformed

    private void jButtonNouveauActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNouveauActionPerformed
        //
        // NOUVEL ACTEUR
        if (jTabbel1.getSelectedIndex() == 0) {
            jLabelMessage.setText("Acteur");
            new JDialogArtisteNouveau(Globale.getMdi(), true, icn);

            String lsRetour = Globale.getChaine();
            if (!lsRetour.equals("")) {
                jTableJouer.setValueAt(lsRetour, jTableJouer.getRowCount() - 1, 1);
            }

//            System.out.println("retour artiste");
        }
        // NOUVEAU REALISATEUR
        if (jTabbel1.getSelectedIndex() == 1) {

            jLabelMessage.setText("Réalisateur");

            new JDialogArtisteNouveau(Globale.getMdi(), true, icn);

            String lsRetour = Globale.getChaine();
            if (!lsRetour.equals("")) {
                jTableRealiser.setValueAt(lsRetour, jTableRealiser.getRowCount() - 1, 1);
            }

        }
        // TOUS LES PAYS existent déjà
//        if (jTabbel1.getSelectedIndex() == 2) {
//
//            jLabelMessage.setText("Pays");
//
//        }
        // TOUTES LES SALLES existent déjà
//        if (jTabbel1.getSelectedIndex() == 3) {
//
//            jLabelMessage.setText("Projection");
//
//        }

    }//GEN-LAST:event_jButtonNouveauActionPerformed

    private void jButtonCLSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCLSActionPerformed
        // 
        jTextFieldTitreOriginal.setText("");

        for (int i = idtmJouer.getRowCount() - 1; i >= 0; i--) {
            idtmJouer.removeRow(i);
        }
        for (int i = idtmRealiser.getRowCount() - 1; i >= 0; i--) {
            idtmRealiser.removeRow(i);
        }
        for (int i = idtmProduire.getRowCount() - 1; i >= 0; i--) {
            idtmProduire.removeRow(i);
        }
        for (int i = idtmProjeter.getRowCount() - 1; i >= 0; i--) {
            idtmProjeter.removeRow(i);
        }
    }//GEN-LAST:event_jButtonCLSActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonCLS;
    private javax.swing.JButton jButtonMoins;
    private javax.swing.JButton jButtonNouveau;
    private javax.swing.JButton jButtonPlus;
    private javax.swing.JButton jButtonValiderAjout;
    private javax.swing.JComboBox jComboBoxGenres;
    private javax.swing.JComboBox jComboBoxRubriques;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelMessage;
    private javax.swing.JList jListCouleurs;
    private javax.swing.JList jListInterdictions;
    private javax.swing.JList jListPublics;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPaneActeurs;
    private javax.swing.JScrollPane jScrollPanePays;
    private javax.swing.JScrollPane jScrollPaneProjections;
    private javax.swing.JScrollPane jScrollPaneRealisateurs;
    private javax.swing.JSpinner jSpinnerAnneeProduction;
    private javax.swing.JSpinner jSpinnerDureeHeures;
    private javax.swing.JSpinner jSpinnerDureeMinutes;
    private javax.swing.JSpinner jSpinnerSemaines;
    private javax.swing.JTabbedPane jTabbel1;
    private javax.swing.JTable jTableJouer;
    private javax.swing.JTable jTableProduire;
    private javax.swing.JTable jTableProjeter;
    private javax.swing.JTable jTableRealiser;
    private javax.swing.JTextArea jTextAreaSynopsis;
    private javax.swing.JTextField jTextFieldDateDeSortie;
    private javax.swing.JTextField jTextFieldEntreesSemaines;
    private javax.swing.JTextField jTextFieldTitre;
    private javax.swing.JTextField jTextFieldTitreOriginal;
    private javax.swing.JTextField jTextFieldTotalEntrees;
    // End of variables declaration//GEN-END:variables
}
